#include<bits/stdc++.h>

using namespace std;
const int maxn = 100 + 20;
typedef long long ll;
ll m, n, p, q;

//O(sqrt(n))
int main() {
    cin >> m;
    m *= 2;

    for (ll i = sqrt(m); i >= 1; i--) {
        if (m % i != 0)continue;
        ll j = m / i;
        //solve (p+q)*(q-p+1)=j*i=m;=> p+q=j&&q-p+1=i;

        q = (j + i - 1) / 2;
        p = (j - i + 1) / 2;

        if (q > p && (p + q) * (q - p + 1) == m) {
            cout << p << " " << q << endl;
        }

    }
}

